package es.cea.agendatelefonica;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * Application Lifecycle Listener implementation class AgendaListener
 *
 */
@WebListener
public class AgendaListener implements ServletContextListener {
    
    public AgendaListener() {
        
    }
	
    public void contextInitialized(ServletContextEvent arg0) {
    	List<ContactoTel> contactos=new ArrayList<ContactoTel>();
		contactos.add(new ContactoTel("Dario", "123456"));
		contactos.add(new ContactoTel("Maria", "7891011"));
		contactos.add(new ContactoTel("Joselito", "12131415"));
    	arg0.getServletContext().setAttribute("contactos", contactos);       
    }
	
    public void contextDestroyed(ServletContextEvent arg0) {        
    }	
}
